package ${packageName}.controller;

import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import ${packageName}.constant.ResultConstant;
import ${packageName}.entity.CommonResult;
import ${packageName}.service.IMutiTableService;
<#if ifUseSwagger == "是">
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.annotations.ApiIgnore;
</#if>

@RestController
@CrossOrigin(origins = "*",allowCredentials = "true",allowedHeaders = "*")
<#if ifUseSwagger == "是">
@Api(tags = "mutiTable接口")
</#if>
@RequestMapping("/mutiTable")
public class MutiTableController {

	@Autowired
	public IMutiTableService service;


	<#list tablesQueryMap?keys as key>

	/**
	 * ${key}查询
	 *
	 * @return
	 */
    <#if ifUseSwagger == "是">
    @ApiOperation(value = "${key}查询")
    </#if>
	@RequestMapping(value = "/${key}Select", method = RequestMethod.POST)
	public CommonResult ${key}Select(@RequestBody Map<String, Object> map) {
		return new CommonResult(ResultConstant.SUCCCSS_CODE, ResultConstant.SUCCESS_MSG, service.${key}Select(map));
	}

	/**
	 * ${key}导出excel
	 *
	 * @return
	 */
    <#if ifUseSwagger == "是">
    @ApiIgnore
    </#if>
	@RequestMapping("/${key}ExportExcel")
	public void ${key}ExportExcel(@RequestParam Map<String, Object> paramMap, HttpServletResponse response) {
		service.${key}ExportExcel(paramMap, response);
	}

	</#list>

}
